import org.tensorflow.SavedModelBundle;
import org.tensorflow.Session;
import org.tensorflow.Tensor;

import java.util.*;

public class Main {
    public static void main(String[] args) {
        SavedModelBundle b = SavedModelBundle.load("C:\\Users\\19710\\Desktop\\deeplearning\\deeplearning\\src\\main\\resources\\tensorflow_model", "serve");
        Session session = b.session();
        Tensor<?> result = session.runner()
                .feed("serving_default_input:0", Tensor.create(new long[]{
                        12689L,
                        56387L,
                        1762L,
                        -44093L,
                        46802L,
                        41433L,
                        -36887L,
                        -53996L,
                        -16166L,
                        -53583L,
                        63884L,
                        -52356L,
                        48474L}, Long.class))
                .fetch("PartitionedCall:0")
                .run()
                .get(0);
        long[] res = result.copyTo(new long[13]);
        System.out.println("model convert to tensorflow: torch.abs result = " + Arrays.toString(res));
    }
}

